Skip to content

Bug fixes#191

Merged
codito merged 2 commits into
masterfrom
bug-fix
Jun 20, 2026
Merged

Bug fixes#191
codito merged 2 commits into
masterfrom
bug-fix

Conversation

@codito

@codito codito commented Jun 20, 2026

Copy link
Copy Markdown
Owner
  • Fix checkpoint_tokens_skipped = cp.tokens.len() instead of cp.position
    to prevent overshooting verified prefix when matching checkpoints
  • Update state.previous_tokens on checkpoint restore to keep periodic
    checkpoint saves from storing stale token data
  • Change cache_status() selection from highest priority to longest
    matching prefix, using priority only as tiebreaker for equal lengths.
    This means Turn 2 reuses the full Turn 1 checkpoint (including
    assistant response) instead of falling back to an older ToolCall
    checkpoint, avoiding unnecessary reprocessing.
  • Add tests: prefers_longer_prefix_over_higher_priority,
    same_length_uses_priority_tiebreaker
  • Remove dead periodic_interval/last_periodic_position fields and
    should_save_periodic method (periodic saves moved out of decode loop)

codito added 2 commits June 20, 2026 10:23
…ckpoint restore

- Fix checkpoint_tokens_skipped = cp.tokens.len() instead of cp.position
  to prevent overshooting verified prefix when matching checkpoints
- Update state.previous_tokens on checkpoint restore to keep periodic
  checkpoint saves from storing stale token data
- Change cache_status() selection from highest priority to longest
  matching prefix, using priority only as tiebreaker for equal lengths.
  This means Turn 2 reuses the full Turn 1 checkpoint (including
  assistant response) instead of falling back to an older ToolCall
  checkpoint, avoiding unnecessary reprocessing.
- Add tests: prefers_longer_prefix_over_higher_priority,
  same_length_uses_priority_tiebreaker
- Remove dead periodic_interval/last_periodic_position fields and
  should_save_periodic method (periodic saves moved out of decode loop)
@codito codito enabled auto-merge (squash) June 20, 2026 12:52
@codito codito merged commit 823ed46 into master Jun 20, 2026
10 checks passed
@codito codito deleted the bug-fix branch June 20, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant